package com.wt.springboot.mapper;

import com.wt.springboot.bean.Employee;
import org.apache.ibatis.annotations.*;

/**
 * Created with IDEA
 * Describe:
 * Author:TianJi
 * Date:2018/11/8
 * Time:13:26
 */
@Mapper
public interface EmployeeMapper {

    @Select("select * from employee where id = #{id}")
    Employee getEmployeeById(Integer id);

    @Update("update employee set lastName = #{lastName},email=#{email},gender=#{gender},d_id=#{dId} where id=#{id}")
    void updateEmployee(Employee employee);

    @Insert("insert into employee(lastName,email,gender,d_id) values(#{lastName},#{email},#{gender},#{dId})")
    void addEmployee(Employee employee);

    @Delete("delete from employee where id = #{id}")
    void deleteEmployee(Integer id);
}
